package testx

import (
	"gitee.com/tietang/terrace-go/v2/base"
	"gitee.com/tietang/terrace-go/v2/base/starter/idbx"
	"gitee.com/tietang/terrace-go/v2/base/starter/ilogrus"
	"gitee.com/tietang/terrace-go/v2/base/starter/ivalidator"
	"gitee.com/tietang/terrace-go/v2/boot"
	_ "gitee.com/tietang/terrace-go/v2/example/order/api"
	_ "gitee.com/tietang/terrace-go/v2/example/order/domain/exts"
	_ "gitee.com/tietang/terrace-go/v2/example/order/service/exts"
	"github.com/tietang/props/v3/ini"
	"github.com/tietang/props/v3/kvs"
)

func init() {

	//获取程序运行文件所在的路径
	file := kvs.GetCurrentFilePath("../order/brun/config.ini", 1)
	//加载和解析配置文件
	conf := ini.NewIniFileCompositeConfigSource(file)
	ilogrus.InitLog(conf)

	base.Register(&base.PropsStarter{})
	base.Register(&idbx.DbxDatabaseStarter{})
	base.Register(&ivalidator.ValidatorStarter{})
	base.Register(&base.HookStarter{})
	app := boot.New(conf)
	app.RapidStart()
}
